﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace JuniorProject.Models.Employee
{
    public class HSAMContext : DbContext
    {
        public HSAMContext()
            : base("DefaultConnection")
        {
        }
    }

    public class HiringSpecialistAppModel
    {
        public HiringSpecialistAppModel(Applications Application, Users User,
                                            JobPostings JobPosting)
        {
            this.ID = Application.ID;
            this.PostingDate = Application.InsertDate;

            this.FirstName = User.FirstName;
            this.LastName = User.LastName;
            this.UserID = User.ID;

            this.JobLocation = JobPosting.Locations.City;
            this.JobPostingID = JobPosting.ID;
            this.JobTitle = JobPosting.Jobs.Title;

            if (Application.StatusID == 33)
                this.BGCheck = true;
            else
                this.BGCheck = false;
        }

        #region APPLICATION TABLE
        [DataType(DataType.Text)]
        [Display(Name = "ApplicationID")]
        public int ID { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Submission Date")]
        public System.DateTime PostingDate { get; set; }

        [Display(Name = "Background Check Passed")]
        public bool BGCheck { get; set; }

        #endregion

        #region USER TABLE
        [DataType(DataType.Text)]
        [Display(Name = "UserID")]
        public int UserID { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Last Name")]
        public string LastName { get; set; }
        #endregion

        #region JOBPOSTINGS TABLE
        [DataType(DataType.Text)]
        [Display(Name = "JobPostingID")]
        public int JobPostingID { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Job Title")]
        public string JobTitle { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Job Location")]
        public string JobLocation { get; set; }
        #endregion
    }
}